package org.colcon.web.client.ui.deprecated;

import org.colcon.web.client.Collective_Congress;
import org.colcon.web.client.ui.ColConPanel;
import org.colcon.web.model.framework.IItem;

import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;

public class InfoPanel extends ColConPanel 
{
	private IItem item;
	
	public InfoPanel(Collective_Congress client, IItem item) 
	{
		super(client, "info", null);
		
		this.item = item;

		init();
	}
	
	public void init()
	{
		clear();
		
		add(getHeader());
		
		add(new Label(item.getText()));
	}
	
	public HorizontalPanel getHeader()
	{
		HorizontalPanel header = new HorizontalPanel();
		
		NamePanel title = new InfoNamePanel(getClient(), item.getId());
		title.setStyleName("info-title");
		header.add(title);
		
		return header;
	}
	
	public IItem getItem()
	{
		return item;
	}
}
